#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 5e5 + 5;
const int M = 1e9 + 7;

int n, k;
string s;

int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);

    while (cin >> n >> k >> s)
    {

        int p = 1; // 至少是第一个字符
        for (int i = 1; i < n; i++)
        {
            if (s[i] > s[i % p])
                break;
            if (s[i] < s[i % p])
                p = i + 1;
        }

        for (int i = 0; i < k; i++)
        {
            cout << s[i % p];
        }
        cout << endl;
    }
    return 0;
}